'use strict';

const path = require('path');

module.exports = {
    dev: {
        // Paths
        assetsSubDirectory: 'static',
        assetsPublicPath: '/',
        proxyTable: {
            // "/ycmp-auth-center": {
            //   target: "http://127.0.0.1:10018", // 你请求的第三方接口http://192.168.0.61:10018,http://192.168.0.30:10018/
            //   changeOrigin: true, // 在本地会创建一个虚拟服务端，然后发送请求的数据，并同时接收请求的数据，这样服务端和服务端进行数据的交互就不会有跨域问题
            //   // pathRewrite: {
            //   //     // 路径重写，
            //   //     "^/ycmp-auth-center": "" // 替换target中的请求地址，也就是说以后你在请求http://api.jisuapi.com/XXXXX这个地址的时候直接写成/api即可。
            //   // }
            // },
            // "/": {
            //   target: "http://127.0.0.1:10018", // 你请求的第三方接口http://192.168.0.61:10018,http://192.168.0.30:10018/
            //   changeOrigin: true, // 在本地会创建一个虚拟服务端，然后发送请求的数据，并同时接收请求的数据，这样服务端和服务端进行数据的交互就不会有跨域问题
            //   // pathRewrite: {
            //   //     // 路径重写，
            //   //     "^/ycmp-auth-center": "" // 替换target中的请求地址，也就是说以后你在请求http://api.jisuapi.com/XXXXX这个地址的时候直接写成/api即可。
            //   // }
            // },
            // "/rap": {
            //   target: "http://rap2.taobao.org:38080/app/mock/13820/api/", // 你请求的第三方接口http://192.168.0.61:10018,http://192.168.0.30:10018/
            //   changeOrigin: true, // 在本地会创建一个虚拟服务端，然后发送请求的数据，并同时接收请求的数据，这样服务端和服务端进行数据的交互就不会有跨域问题
            //   pathRewrite: {
            //     // 路径重写，
            //     "/rap": "" // 替换target中的请求地址，也就是说以后你在请求http://api.jisuapi.com/XXXXX这个地址的时候直接写成/api即可。
            //   }
            // },
        },

        // Various Dev Server settings
        host: '0.0.0.0', // can be overwritten by process.env.HOST
        port: 3000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
        autoOpenBrowser: false,
        errorOverlay: true,
        notifyOnErrors: true,
        poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-

        // Use Eslint Loader?
        // If true, your code will be linted during bundling and
        // linting errors and warnings will be shown in the console.
        useEslint: true,
        // If true, eslint errors and warnings will also be shown in the error overlay
        // in the browser.
        showEslintErrorsInOverlay: false,

        /**
         * Source Maps
         */

        // https://webpack.js.org/configuration/devtool/#development
        devtool: 'cheap-module-eval-source-map',

        // If you have problems debugging vue-files in devtools,
        // set this to false - it *may* help
        // https://vue-loader.vuejs.org/en/options.html#cachebusting
        cacheBusting: false,

        cssSourceMap: false,
    },

    build: {
        // 2021 env
        localEnv: require('./local.env'),
        devEnv: require('./dev.env'),
        sitEnv: require('./sit.env'),
        uatEnv: require('./uat.env'),
        proEnv: require('./pro.env'),
        bizEnv: require('./biz.env'),
        obEnv: require('./ob.env'),
        projectEnv: require('./project.env'),
        maxwealthEnv: require('./maxwealth.env'),
        pyaxaEnv: require('./pyaxa.env'),
        springscapitalEnv: require('./springscapital.env'),
        fscindaEnv: require('./fscinda.env'),
        cibfundEnv: require('./cibfund.env'),
        // Template for index.html
        index: path.resolve(__dirname, '../dist/index.html'),

        // Paths
        assetsRoot: path.resolve(__dirname, '../dist'),
        assetsSubDirectory: 'static',
        assetsPublicPath: './',

        /**
         * Source Maps
         */

        productionSourceMap: false,
        // https://webpack.js.org/configuration/devtool/#production
        devtool: '#source-map',

        // Gzip off by default as many popular static hosts such as
        // Surge or Netlify already gzip all static assets for you.
        // Before setting to `true`, make sure to:
        // npm install --save-dev compression-webpack-plugin
        productionGzip: false,
        productionGzipExtensions: ['js', 'css'],

        // Run the build command with an extra argument to
        // View the bundle analyzer report after build finishes:
        // `npm run build --report`
        // Set to `true` or `false` to always turn it on or off
        bundleAnalyzerReport: process.env.npm_config_report,
    },
};
